package com.zhuxiang.test2;

/**
 * 定义通话套餐类
 */
public class CallPlan extends PhonePlans implements CallService {
    //通话时长
    private  int callLength;
    //短信条数
    private  int smsNum;

    public CallPlan(int callLength, int smsNum) {
        super();
        this.callLength = callLength;
        this.smsNum = smsNum;
    }

    public int getCallLength() {
        return callLength;
    }

    public void setCallLength(int callLength) {
        this.callLength = callLength;
    }

    public int getSmsNum() {
        return smsNum;
    }

    public void setSmsNum(int smsNum) {
        this.smsNum = smsNum;
    }


    /**
     * 显示通话套餐信息的方法
     */
    @Override
    public void show(){
        System.out.println("通话时长："+ getCallLength()+"分钟,短信条数："+ getSmsNum()+"条,每月资费："+getRate()+"元");
    }

    /**
     * 重写通话服务里的方法
     * @param callLength
     * @param type
     * @return
     */
    @Override
    public int call(int callLength, String type) {
        System.out.println("剩余通话分钟："+(getCallLength()-callLength)+"分钟，手机卡类型："+ type);
        return callLength;
    }
}
